# Screen - Screen interface. All screens has to implement this interface!
# Copyright (C) 2007 Lauri Taimila
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

__licence__ = "GPLv2"
__copyright__ = "2007, Lauri Taimila"
__author__ = "Lauri Taimila <lauri@taimila.com>"

class Screen(object):
    """
    Screen interface
    
    Screen represents a view. View includes all the widgets on the screen.
    There can be for example Photographs view, Music view, Feed view etc.
    """
    
    # Screen type constants
    NORMAL = 0
    DIALOG = 1
    OSD = 2
    
    def update(self):
        """
        Update screen widgets. This is called always when screen is poped from
        the screen history. Not all widgets need update. For performance reasons
        you should only update those widgets that might have been changed. For
        example main menu may or may not contain "Currently Playing" menuitem.
        """
        pass

    def get_type(self):
        """
        Get screen type: Screen.NORMAL, Screen.OSD or Screen.DIALOG
        @return: Integer
        """
        return None
        
    def get_name(self):
        """
        Get screen name (human readble)
        @return: String
        """
        return "not implemented"
    
    def get_group(self):
        """
        Get all actors of the Screen in clutter.Group
        @return: clutter.Group
        """
        return None
    
    def handle_key_press_event(self, event):   
        """
        Handle key pressed event. This is called for current screen when key
        press action occurs. This way current screen can define how to react.
        """
        pass
    